import { Divider } from 'antd';
import { Avatar, Card } from 'antd';
import { MycardProps } from './interface/index'
const Mycard = ({ data }: MycardProps) => {
    const { Meta } = Card;

    return (
        <>
            <Card
                hoverable
                style={{ width: 240 }}
                cover={<img alt="example" src={data.fileUrl} />}
                actions={[
                    <>
                        <span> {(() => {
                            switch (data.classification) {
                                case 0:
                                    return '前端';
                                case 1:
                                    return '后端';
                                case 2:
                                    return '测试';
                                case 3:
                                    return '软技能';
                                default:
                                    return '前端';
                            }
                        })()}
                        </span>
                        <Divider type="vertical" />
                        <span>
                            {(() => {
                                switch (data.toPopulation) {
                                    case 0:
                                        return '建议初学者学习';
                                    case 1:
                                        return '建议熟练者学习';
                                    case 2:
                                        return '建议资深者学习';
                                    default:
                                        return '建议初学者学习';
                                }
                            })()}

                        </span>
                        <Divider type="vertical" />
                        <span> {data.isOnline === 0 ? '线下' : '线上'}</span>
                    </>

                ]}
            >
                <Meta title={data.courseName} description={data.description}
                    avatar={<Avatar src={data.courseSourceUrl} />}
                />
            </Card>
        </>
    );
};

export default Mycard;
